Integrand size = 23, antiderivative size = 77 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \tan ^3(e+f x) \, dx=\frac {a^2 \log (\cos (e+f x))}{f}+\frac {a (a-2 b) \sec ^2(e+f x)}{2 f}+\frac {(2 a-b) b \sec ^4(e+f x)}{4 f}+\frac {b^2 \sec ^6(e+f x)}{6 f} \]
a^2*ln(cos(f*x+e))/f+1/2*a*(a-2*b)*sec(f*x+e)^2/f+1/4*(2*a-b)*b*sec(f*x+e) ^4/f+1/6*b^2*sec(f*x+e)^6/f
Time = 0.29 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.39 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \tan ^3(e+f x) \, dx=\frac {\cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \left (12 a^2 \log (\cos (e+f x))+6 a (a-2 b) \sec ^2(e+f x)+3 (2 a-b) b \sec ^4(e+f x)+2 b^2 \sec ^6(e+f x)\right )}{3 f (a+2 b+a \cos (2 e+2 f x))^2} \]
(Cos[e + f*x]^4*(a + b*Sec[e + f*x]^2)^2*(12*a^2*Log[Cos[e + f*x]] + 6*a*( a - 2*b)*Sec[e + f*x]^2 + 3*(2*a - b)*b*Sec[e + f*x]^4 + 2*b^2*Sec[e + f*x ]^6))/(3*f*(a + 2*b + a*Cos[2*e + 2*f*x])^2)
Time = 0.27 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.92, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3042, 4626, 354, 85, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (e+f x)^3 \left (a+b \sec (e+f x)^2\right )^2dx\) |
\(\Big \downarrow \) 4626 |
\(\displaystyle -\frac {\int \left (1-\cos ^2(e+f x)\right ) \left (a \cos ^2(e+f x)+b\right )^2 \sec ^7(e+f x)d\cos (e+f x)}{f}\) |
\(\Big \downarrow \) 354 |
\(\displaystyle -\frac {\int \left (1-\cos ^2(e+f x)\right ) \left (a \cos ^2(e+f x)+b\right )^2 \sec ^4(e+f x)d\cos ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 85 |
\(\displaystyle -\frac {\int \left (b^2 \sec ^4(e+f x)+(2 a-b) b \sec ^3(e+f x)+a (a-2 b) \sec ^2(e+f x)-a^2 \sec (e+f x)\right )d\cos ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {-a^2 \log \left (\cos ^2(e+f x)\right )-\frac {1}{2} b (2 a-b) \sec ^2(e+f x)-a (a-2 b) \sec (e+f x)-\frac {1}{3} b^2 \sec ^3(e+f x)}{2 f}\) |
-1/2*(-(a^2*Log[Cos[e + f*x]^2]) - a*(a - 2*b)*Sec[e + f*x] - ((2*a - b)*b *Sec[e + f*x]^2)/2 - (b^2*Sec[e + f*x]^3)/3)/f
3.4.25.3.1 Defintions of rubi rules used
Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_] : > Int[ExpandIntegrand[(a + b*x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && (NeQ[n, -1] || EqQ[p, 1]) && NeQ[b*e + a* f, 0] && ( !IntegerQ[n] || LtQ[9*p + 5*n, 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, d, e, f])) && (NeQ[n + p + 3, 0] || EqQ[p, 1])
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S ymbol] :> Simp[1/2 Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x , x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ [(m - 1)/2]
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_ )]^(m_.), x_Symbol] :> Module[{ff = FreeFactors[Cos[e + f*x], x]}, Simp[-(f *ff^(m + n*p - 1))^(-1) Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*(ff* x)^n)^p/x^(m + n*p)), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n} , x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p]
Time = 4.57 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.99
method | result | size |
parts | \(\frac {a^{2} \left (\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {b^{2} \left (\frac {\sec \left (f x +e \right )^{6}}{6}-\frac {\sec \left (f x +e \right )^{4}}{4}\right )}{f}+\frac {a b \tan \left (f x +e \right )^{4}}{2 f}\) | \(76\) |
derivativedivides | \(\frac {\frac {b^{2} \sec \left (f x +e \right )^{6}}{6}+\frac {a b \sec \left (f x +e \right )^{4}}{2}-\frac {\sec \left (f x +e \right )^{4} b^{2}}{4}+\frac {a^{2} \sec \left (f x +e \right )^{2}}{2}-\sec \left (f x +e \right )^{2} a b -a^{2} \ln \left (\sec \left (f x +e \right )\right )}{f}\) | \(81\) |
default | \(\frac {\frac {b^{2} \sec \left (f x +e \right )^{6}}{6}+\frac {a b \sec \left (f x +e \right )^{4}}{2}-\frac {\sec \left (f x +e \right )^{4} b^{2}}{4}+\frac {a^{2} \sec \left (f x +e \right )^{2}}{2}-\sec \left (f x +e \right )^{2} a b -a^{2} \ln \left (\sec \left (f x +e \right )\right )}{f}\) | \(81\) |
risch | \(-i a^{2} x -\frac {2 i a^{2} e}{f}-\frac {2 \left (-3 a^{2} {\mathrm e}^{10 i \left (f x +e \right )}+6 a b \,{\mathrm e}^{10 i \left (f x +e \right )}-12 a^{2} {\mathrm e}^{8 i \left (f x +e \right )}+12 a b \,{\mathrm e}^{8 i \left (f x +e \right )}+6 b^{2} {\mathrm e}^{8 i \left (f x +e \right )}-18 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}+12 a b \,{\mathrm e}^{6 i \left (f x +e \right )}-4 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}-12 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}+12 a b \,{\mathrm e}^{4 i \left (f x +e \right )}+6 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}-3 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}+6 a b \,{\mathrm e}^{2 i \left (f x +e \right )}\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{6}}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{f}\) | \(234\) |
a^2/f*(1/2*tan(f*x+e)^2-1/2*ln(1+tan(f*x+e)^2))+b^2/f*(1/6*sec(f*x+e)^6-1/ 4*sec(f*x+e)^4)+1/2*a*b/f*tan(f*x+e)^4
Time = 0.27 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.03 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \tan ^3(e+f x) \, dx=\frac {12 \, a^{2} \cos \left (f x + e\right )^{6} \log \left (-\cos \left (f x + e\right )\right ) + 6 \, {\left (a^{2} - 2 \, a b\right )} \cos \left (f x + e\right )^{4} + 3 \, {\left (2 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, b^{2}}{12 \, f \cos \left (f x + e\right )^{6}} \]
1/12*(12*a^2*cos(f*x + e)^6*log(-cos(f*x + e)) + 6*(a^2 - 2*a*b)*cos(f*x + e)^4 + 3*(2*a*b - b^2)*cos(f*x + e)^2 + 2*b^2)/(f*cos(f*x + e)^6)
Time = 0.56 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.66 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \tan ^3(e+f x) \, dx=\begin {cases} - \frac {a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {a b \tan ^{2}{\left (e + f x \right )} \sec ^{2}{\left (e + f x \right )}}{2 f} - \frac {a b \sec ^{2}{\left (e + f x \right )}}{2 f} + \frac {b^{2} \tan ^{2}{\left (e + f x \right )} \sec ^{4}{\left (e + f x \right )}}{6 f} - \frac {b^{2} \sec ^{4}{\left (e + f x \right )}}{12 f} & \text {for}\: f \neq 0 \\x \left (a + b \sec ^{2}{\left (e \right )}\right )^{2} \tan ^{3}{\left (e \right )} & \text {otherwise} \end {cases} \]
Piecewise((-a**2*log(tan(e + f*x)**2 + 1)/(2*f) + a**2*tan(e + f*x)**2/(2* f) + a*b*tan(e + f*x)**2*sec(e + f*x)**2/(2*f) - a*b*sec(e + f*x)**2/(2*f) + b**2*tan(e + f*x)**2*sec(e + f*x)**4/(6*f) - b**2*sec(e + f*x)**4/(12*f ), Ne(f, 0)), (x*(a + b*sec(e)**2)**2*tan(e)**3, True))
Time = 0.19 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.48 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \tan ^3(e+f x) \, dx=\frac {6 \, a^{2} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac {6 \, {\left (a^{2} - 2 \, a b\right )} \sin \left (f x + e\right )^{4} - 3 \, {\left (4 \, a^{2} - 6 \, a b - b^{2}\right )} \sin \left (f x + e\right )^{2} + 6 \, a^{2} - 6 \, a b - b^{2}}{\sin \left (f x + e\right )^{6} - 3 \, \sin \left (f x + e\right )^{4} + 3 \, \sin \left (f x + e\right )^{2} - 1}}{12 \, f} \]
1/12*(6*a^2*log(sin(f*x + e)^2 - 1) - (6*(a^2 - 2*a*b)*sin(f*x + e)^4 - 3* (4*a^2 - 6*a*b - b^2)*sin(f*x + e)^2 + 6*a^2 - 6*a*b - b^2)/(sin(f*x + e)^ 6 - 3*sin(f*x + e)^4 + 3*sin(f*x + e)^2 - 1))/f
Leaf count of result is larger than twice the leaf count of optimal. 385 vs. \(2 (71) = 142\).
Time = 0.88 (sec) , antiderivative size = 385, normalized size of antiderivative = 5.00 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \tan ^3(e+f x) \, dx=-\frac {6 \, a^{2} \log \left ({\left | -\frac {\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2 \right |}\right ) - 6 \, a^{2} \log \left ({\left | -\frac {\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 2 \right |}\right ) + \frac {11 \, a^{2} {\left (\frac {\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}^{3} + 90 \, a^{2} {\left (\frac {\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}^{2} + 228 \, a^{2} {\left (\frac {\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 96 \, a b {\left (\frac {\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 48 \, b^{2} {\left (\frac {\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 184 \, a^{2} - 192 \, a b + 32 \, b^{2}}{{\left (\frac {\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right )}^{3}}}{12 \, f} \]
-1/12*(6*a^2*log(abs(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e ) - 1)/(cos(f*x + e) + 1) + 2)) - 6*a^2*log(abs(-(cos(f*x + e) + 1)/(cos(f *x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2)) + (11*a^2*((cos (f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) ^3 + 90*a^2*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(c os(f*x + e) + 1))^2 + 228*a^2*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (co s(f*x + e) - 1)/(cos(f*x + e) + 1)) - 96*a*b*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) - 48*b^2*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + 184*a^ 2 - 192*a*b + 32*b^2)/((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 2)^3)/f
Time = 20.18 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.19 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \tan ^3(e+f x) \, dx=\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {{\left (a+b\right )}^2}{2}+\frac {b^2}{2}-b\,\left (a+b\right )\right )}{f}-\frac {{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {b^2}{4}-\frac {b\,\left (a+b\right )}{2}\right )}{f}-\frac {a^2\,\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,f}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^6}{6\,f} \]